package com.ruyuan.eshop.construction.converter;

import com.ruyuan.eshop.construction.domain.entity.AttributeKeyDO;
import com.ruyuan.eshop.construction.domain.entity.AttributeValueDO;
import com.ruyuan.eshop.construction.domain.request.AttributeRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * 品类相关对象克隆
 * @author zhonghuashishan
 * @version 1.0
 */
@Mapper(componentModel = "spring")
public interface AttributeConverter {

    /**
     * 对象克隆
     *
     * @param attributeKeyRequest
     * @param operateUser
     * @return com.ruyuan.eshop.construction.domain.entity.AttributeKeyDO
     * @author zhonghuashishan
     */
    @Mapping(target = "updateUser", source = "operateUser")
    AttributeKeyDO converterKeyDO(AttributeRequest.AttributeKeyRequest attributeKeyRequest, Integer operateUser);

    /**
     * 对象克隆
     *
     * @param attributeValueRequest
     * @param operateUser
     * @return com.ruyuan.eshop.construction.domain.entity.AttributeKeyDO
     * @author zhonghuashishan
     */
    @Mapping(target = "updateUser", source = "operateUser")
    AttributeKeyDO converterValueDO(AttributeRequest.AttributeValueRequest attributeValueRequest, Integer operateUser);

    /**
     * 对象克隆
     *
     * @param attributeValueRequests
     * @return java.util.List<com.ruyuan.eshop.construction.domain.entity.AttributeValueDO>
     * @author zhonghuashishan
     */
    List<AttributeValueDO> converterValueDOList(List<AttributeRequest.AttributeValueRequest> attributeValueRequests);
}
